<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="UTF-8">
	<meta name="viewport"
		content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
	<meta http-equiv="X-UA-Compatible" content="ie=edge">
	<link rel="stylesheet" href="__CSS__/ex/common.css">
	<link rel="stylesheet" href="__CSS__/ex/login.css">
	<title>EX</title>
    <script src="__JS__/ios-web-app.js"></script>
</head>

<body>
	<div class="login">
		<div class="header">
			<div class="header_left"><a href="{:U('Index/index')}"><img src="__IMG__/ex/back.png" alt=""></a></div>
			<p>Đăng nhập</p>
			<div class="header_right"></div>
		</div>
		<div class="loginpic log_pic">
			<img src="__IMG__/ex/exlogo1.png" alt="">
		</div>
		<div class="loginform">
			<div class="form_content username">
				<img src="__IMG__/ex/user.png" alt="">
				<div class="line"></div>
				<input type="text" id="username" placeholder="Nhập tài khoản">
			</div>
			<div class="form_content">
				<img src="__IMG__/ex/pwd.png" alt="">
				<div class="line"></div>
				<input type="password" id="password" placeholder="Mật khẩu">
			</div>
			<div class="btn login_btn lsub" id="sub">Đăng nhập ví tiền</div>
			<p class="to_forget">
				<a href="recover.html">Quên mật khẩu？</a>
			</p>
		</div>
	</div>

	<script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script>
	<script>
		$('#sub').click(function () {
			$.ajax({
				type: "post",
				url: "{:U('Public/login')}",
				data: {
					username: $('#username').val(),
					password: $('#password').val(),
				},
				dataType: "json",
				success: function (data) {
					if (data.code == 1) {
						alert(data.msg);
					} else {
						alert(data.msg);
						window.location.href = data.data;
					}
				}
			});
		});
	</script>
</body>

</html>